Skip to content

fix(native-federation-runtime) runtime crash with non-JS routing (like static HTML apps or SSR apps) #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aukevanoost
Copy link

@Aukevanoost Aukevanoost commented Nov 14, 2024

This issue is an edge case:

Since the ‘host remoteEntry.json’ fetch is hardcoded as a relative URL, therefore when used in Stateful SSR websites like (Java Wicket, Ruby, PHP etc.) or static HTML websites. The relative url will fail on all pages that are not the homepage.

Example

With this file structure

/
└── public/
    ├── products/
    │   └── index.html
    ├── contact/
    │   └── index.html
    ├── index.html
    └── remoteEntry.json

RemoteEntry.json resolves on

RemoteEntry.json fails to resolve on

Solution

Assuming these websites don't have anything to share or expose anyway, an 'opt-out' functionality for the host that prevents the fetch of a potentially useless remoteEntry.json object, combined with a way to provide an url for other edge cases. With as default the hardcoded url to be backwards compatible.

@Aukevanoost Aukevanoost changed the title [native-federation-runtime] Fix runtime crash with non-JS routing (like static HTML apps or SSR apps) fix(native-federation-runtime) runtime crash with non-JS routing (like static HTML apps or SSR apps) Nov 14, 2024
@manfredsteyer manfredsteyer force-pushed the main branch 4 times, most recently from 93c1fc5 to 18c2874 Compare January 12, 2025 19:32
@Aukevanoost Aukevanoost reopened this May 30, 2025
@Aukevanoost
Copy link
Author

Aukevanoost commented May 30, 2025

Note: This resolves the issue of forcing the host application to have a "remoteEntry.json" file. This is not always the case., especially with host applications that are not an SPA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant